-
Notifications
You must be signed in to change notification settings - Fork 64
ttx service: timeout via context - part 1 #1028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: SREENIDHI DR <[email protected]>
Signed-off-by: SREENIDHI DR <[email protected]>
Signed-off-by: sreenidhi <[email protected]>
Signed-off-by: sreenidhi <[email protected]>
Signed-off-by: sreenidhi <[email protected]>
token/services/ttx/auditor.go
Outdated
if err != nil { | ||
span.RecordError(err) | ||
return nil, errors.WithMessage(err, "failed to read audit event") | ||
} | ||
if len(signature) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this check needed? it might be misleading as to what is expected from the code if this can't happen. normally I expect that if err == nil, there data is valid.
|
||
msg, err := ReadMessage(context.Session(), time.Minute*4) | ||
jsonSession := session2.JSON(context) | ||
msg, err := jsonSession.ReceiveRawWithTimeout(time.Minute * 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could also extract these durations to constants, depending on what we are waiting for, e.g. signatureRcvTimeout
, txRcvTimeout
, to make sure we are aligned and to have a better overview. ideally I would even add them as fields in the structure objects and set the default values in the constructors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments to address
Signed-off-by: sreenidhi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.